package com.example.userspringboot.controller;

import com.example.userspringboot.common.Result;
import com.example.userspringboot.entity.DrugDetails;
import com.example.userspringboot.service.DrugDetailsService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/drugDetails")
public class DrugDetailsController {

    @Resource
    DrugDetailsService drugDetailsService;

    @GetMapping("/selectDetailsByClassificationName")
    public Result selectDetailsByClassificationName(@RequestParam String classificationName) {
        List<DrugDetails> drugDetails = drugDetailsService.selectDetailsByClassificationName(classificationName);
        return Result.success(drugDetails);
    }

}
